<%@page import="tk.redbluelotto.robot.domain.RedBall"%>
<%@page import="tk.redbluelotto.robot.calculator.Constants"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>双色球计算器</title>
</head>
<body>
	<h2>请输入计算条件</h2>
	<form:form method="post" action="calculator.do?cal"
		modelAttribute="redForm" id="redForm">
		<table width="100%" border="1">
			<tr>
				<td>余3比</td>
				<td width="90%"><input type="text" name="mod3"
					value="${redForm.mod3}" />【例如： 余3比3:2:1输入‘321’】</td>
			</tr>
			<tr>
				<td>偶数个数</td>
				<td><input type="text" name="mod2" value="${redForm.mod2}" /></td>
			</tr>
			<tr>
				<td>质数个数</td>
				<td><input type="text" name="prime" value="${redForm.prime }" /></td>
			</tr>
			<tr>
				<td>连号位置</td>
				<td><input type="text" name="adjacent"
					value="${redForm.adjacent }" />【例如： 第一、二位连号输入‘12’】</td>
			</tr>
			<tr>
				<td>重号个数</td>
				<td><input type="text" name="duplication"
					value="${redForm.duplication }" /></td>
			</tr>
			<tr>
				<td>自定义与规则</td>
				<td><input type="text" style="width: 450" name="andRule"
					value="${redForm.andRule }" width="200"></td>
			</tr>
			<tr>
				<td>自定义运算规则</td>
				<td><input type="text" style="width: 450" name="logicRule"
					value="${redForm.logicRule }" width="200"></td>
			</tr>
			<tr>
				<td>自定义重叠规则</td>
				<td><input type="text" style="width: 450" name="dupRule"
					value="${redForm.dupRule }" width="200"></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" name="calculate"
					value="计算" /> <input type="button" name="reset" value="重置" /></td>
			</tr>
		</table>
	</form:form>
	<c:if test="${redballs != null}">
		<h3>总计查询到:${fn:length(redballs)}，耗时${redForm.time}毫秒。</h3>
	</c:if>
	<table border="1" width="100%">
		<tr>
			<td>序号</td>
			<td>红1~6</td>
<!-- 			<td>余三比0:1:2</td> -->
<!-- 			<td>偶奇比0:1</td> -->
<!-- 			<td>质合比</td> -->
			<!-- 			<td>尾数比0~9</td> -->
			<td>和值</td>
		</tr>
		<c:forEach items="${redballs}" var="redball" varStatus="s">
			<tr>
				<td>${s.count}</td>
				<td>${redball.red1} &nbsp; ${redball.red2} &nbsp; ${redball.red3} &nbsp; ${redball.red4} &nbsp;  ${redball.red5} &nbsp; ${redball.red6}</td>
<%-- 				<td>${redball.mod3_0}:${redball.mod3_1}:${6-redball.mod3_0-redball.mod3_1}</td> --%>
<%-- 				<td>${redball.mod2_0}:${6-redball.mod2_0}</td> --%>
<%-- 				<td>${redball.prime}:${6-redball.prime}</td> --%>
				<%-- 				${redball.red1%10}:${redball.mod10_1}:${redball.mod10_2}:${redball.mod10_3}:${redball.mod10_4}:${redball.mod10_5}:${redball.mod10_6}:${redball.mod10_7}:${redball.mod10_8}:${redball.mod10_9}</td> --%>
				<td>${redball.red1+redball.red2+redball.red3+redball.red4+redball.red5+redball.red6}</td>
			</tr>
		</c:forEach>
	</table>

</body>
</html>
